﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GalaSoft.MvvmLight;
using ElementLib;
namespace Project1
{
    public class ComplexInfoModel: ObservableObject
    {
        private string key = "", text = "";
        private string elementName;
        private string elementType;
        private Action getInfoAction;
        private Action getSelectedAction;
        private Point location;

        public ComplexInfoModel()
        {

        }
        public ComplexInfoModel(ComplexInfoModel complexInfoModel)
        {
            this.key = complexInfoModel.key;
            this.text = complexInfoModel.text;
            this.elementName = complexInfoModel.elementName;
            this.elementType = complexInfoModel.elementType;
            this.getInfoAction = complexInfoModel.getInfoAction;
            this.getSelectedAction = complexInfoModel.getSelectedAction;
            this.location = complexInfoModel.location;
        }

        public void setCallBack(Action getInfoAction, Action getSelectedAction )
        {
            this.getInfoAction = getInfoAction;
            this.getSelectedAction = getSelectedAction;
        }
        public void GetInfoCallBack()
        {
            getInfoAction.Invoke();
        }
        public void GetSelectedCallBack()
        {
            getSelectedAction.Invoke();
        }

        public string Key
        {
            get
            {
                return key;
            }
            set
            {
                key = value;
                RaisePropertyChanged(() => Key);
            }
        }

        public string ElementName
        {
            get { return elementName; }
            set { elementName = value; RaisePropertyChanged(() => ElementName); }
        }
        public string ElementType
        {
            get { return elementType; }
            set { elementType = value; RaisePropertyChanged(() => ElementType); }
        }
        public Point Location
        {
            get { return location; }
            set { location = value; RaisePropertyChanged(() => Location); }
        }

        public string Text
        {
            get
            {
                return text;
            }
            set
            {
                text = value;
                RaisePropertyChanged(() => Text);
            }
        }
    }
}
